package Java攻略._3_流式操作._8_汇总统计;

import java.util.DoubleSummaryStatistics;
import java.util.stream.DoubleStream;

public class _42_summaryStatistics方法 {

    public static void main(String[] args) {

        DoubleSummaryStatistics doubleSummaryStatistics = DoubleStream.generate(Math::random)
                .limit(1_000_000)
                .summaryStatistics();

        System.out.println(doubleSummaryStatistics);

        System.out.println("count : " + doubleSummaryStatistics.getCount());
        System.out.println("min : " + doubleSummaryStatistics.getMin());
        System.out.println("max : " + doubleSummaryStatistics.getMax());
        System.out.println("sum : " + doubleSummaryStatistics.getSum());
        System.out.println("ave : " + doubleSummaryStatistics.getAverage());
    }
}
